package com.ly.airline.utils;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ：xxl
 * @ClassName WebMvcConfig
 * @date ：Created in 2022/3/20 13:26
 * @description： TODO
 * @modified By：
 * @version: 1.0
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        /**
         * 资源映射路径
         * addResourceHandler：访问映射路径
         * addResourceLocations：资源绝对路径
         */
        registry.addResourceHandler("/upload/**").addResourceLocations("file:D:/javaproject/upload/");
//        registry.addResourceHandler("/web/**").addResourceLocations("/");
    }
}
